from flask import Flask, render_template

app = Flask(__name__)


class User:
    def __init__(self, name, age):
        self.name = name
        self.age = age


@app.route('/')
def hello_world():  # put application's code here
    user = User(name="张三", age=24)
    person = {
        "name": "李四",
        "age": 24
    }
    return render_template("index.html", user=user, person=person)


@app.route("/blog/detail/<id>")
def blog_detail(id):
    print(type({"id": id, "username": "张三"}))
    return render_template("blog_detail.html", data={"id": id, "username": "张三"})


if __name__ == '__main__':
    app.run()
